package 简单工厂模式;


public class OperationFactory {
	//简单工厂模式
	public static Operation getOperation(String oper){
		if("+".equals(oper)){
			return new AddOperation();
		}else if("-".equals(oper)){
			return new SubOperation();
		}else if("*".equals(oper)){
			return new MulOperation();
		}else if("/".equals(oper)){
			return new DivOperation();
		}else{
			return null;	
		}		
	}
}
